/**
 * flashsocket链接
 * by blue
 * 功能：flash方式socket接口
 */
fangimjs.define("sdk/flashSocket", ["util/util", "setting/setting", "swfobject", "sdk/socket"], function (require, exports, module) {
    "use strict";
    /*flash加载判断操作*/
    var socket = require('sdk/socket');
    function flashSocket() {
        /**
         * flash对象
         * @type {null}
         * @private
         */
        var _core = null;
        /**
         * 初始化
         */
        this.init();
        /**
         * 获取并返回flash对象
         * @returns {null}
         */
        this.core = function () {
            if (_core == null) {
                _core = require("swfobject").getObjectById('fang_im_swf');
            }
            return _core;
        };
        this.initSocket = function() {
            var data = fangimjs.data.vars.config;
            this.initSocketData(!!data.username ? "flashlg" : "flash");
        };
    }
    flashSocket.prototype = socket;
    module.exports = new flashSocket();
});
